package routes

import (
	"gitee.com/song-yao-shun/MQH/controller"
	"gitee.com/song-yao-shun/MQH/middleware"
	"github.com/gin-gonic/gin"
)

func PostRoutes(r *gin.Engine){
	postController := controller.NewPostController()

	post := r.Group("api/posts",middleware.AuthMiddleware())
	{
		post.POST("",postController.Create)
		post.PUT("/:id",postController.Update)
		post.GET("/:id",postController.Show)
		post.DELETE("/:id",postController.Delete)
		post.POST("/getall",postController.List)
	}
}
